﻿<UserControl x:Class="SlvPartecipazione.Risposta"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Name="UCRisposta">
    <UserControl.Resources>
        <Style x:Key="fumettoStyle"
           TargetType="Image">
            <Setter Property="Margin"
              Value="0,5,0,0" />
            <Setter Property="Width"
              Value="415" />
            <Setter Property="Stretch"
              Value="None" />
        </Style>
    </UserControl.Resources>
        <Grid x:Name="LayoutRoot">
        <Canvas Width="420" Height="300" x:Name="rectFumetto">
            <Canvas.Resources>
                <Storyboard x:Name="sbShowAutore">
                    <DoubleAnimation Storyboard.TargetName="sbAutore" Storyboard.TargetProperty="RotationX" From="90.0" To="0.0" Duration="0:0:0.5" />
                </Storyboard>
                <Storyboard x:Name="sbHideAutore">
                    <DoubleAnimation Storyboard.TargetName="sbAutore" Storyboard.TargetProperty="RotationX" From="0.0" To="90.0" Duration="0:0:0.1" />
                </Storyboard>
                <Storyboard x:Name="sbShowSuggerimento">
                    <DoubleAnimation Storyboard.TargetName="sbSuggerimento" Storyboard.TargetProperty="RotationX" From="90.0" To="0.0" Duration="0:0:0.5" />
                </Storyboard>
                <Storyboard x:Name="sbHideSuggerimento">
                    <DoubleAnimation Storyboard.TargetName="sbSuggerimento" Storyboard.TargetProperty="RotationX" From="0.0" To="90.0" Duration="0:0:0.1" />
                </Storyboard>
                <Storyboard x:Name="sbShowForm">
                    <DoubleAnimation
                        Storyboard.TargetName="imgFumetto"
                        Storyboard.TargetProperty="Opacity"
                        From="0.0" To="1.0" Duration="0:0:1" 
                        />
                    <DoubleAnimation Storyboard.TargetName="imgFumetto" Storyboard.TargetProperty="(Canvas.Top)"  From="{Binding ElementName=UCRisposta, Path=FromY}" To="{Binding ElementName=UCRisposta, Path=ToY}" Duration="0:0:1.5">
                        <DoubleAnimation.EasingFunction>
                            <ElasticEase Oscillations="2" EasingMode="EaseOut" Springiness="4"></ElasticEase>
                        </DoubleAnimation.EasingFunction>
                    </DoubleAnimation>
                </Storyboard>
                <Storyboard x:Name="sbHideForm">
                    <DoubleAnimation
                        Storyboard.TargetName="imgFumetto"
                        Storyboard.TargetProperty="Opacity"
                        From="1.0" To="0" Duration="0:0:0.5" 
                        />
                    <DoubleAnimation Storyboard.TargetName="imgFumetto" Storyboard.TargetProperty="(Canvas.Top)"  From="{Binding ElementName=UCRisposta, Path=ToY}" To="{Binding ElementName=UCRisposta, Path=FromY}" Duration="0:0:2">
                        <DoubleAnimation.EasingFunction>
                            <ElasticEase Oscillations="2" EasingMode="EaseOut" Springiness="4"></ElasticEase>
                        </DoubleAnimation.EasingFunction>
                    </DoubleAnimation>
                </Storyboard>
            </Canvas.Resources>
            
            <Canvas x:Name="imgFumetto">
                <TextBlock x:Name="txtLabelRisposta" Text="Scrivi il titolo :" Margin="130, 50, 0, 0"
                        FontWeight="Bold"
                        FontSize="15"
                        VerticalAlignment="Center" HorizontalAlignment="Left" Canvas.ZIndex="3" Foreground="White" />
                <TextBlock x:Name="txtAutore" Text="{Binding ElementName=UCRisposta, Path=Autore}" Margin="130, 160, 0, 0"
                        Foreground="White"
                        FontWeight="Bold"
                       FontSize="15"
                        VerticalAlignment="Center" HorizontalAlignment="Left" Canvas.ZIndex="3">
                    <TextBlock.Projection>
                        <PlaneProjection x:Name="sbAutore"/>
                    </TextBlock.Projection>
                </TextBlock>
                <TextBlock x:Name="txtSuggerimento" Text="{Binding ElementName=UCRisposta, Path=Suggerimento}" Margin="130, 210, 0, 0"
                                                 Foreground="White"
                                                 FontWeight="Bold" FontSize="15"
                                                 VerticalAlignment="Center" HorizontalAlignment="Left" Canvas.ZIndex="3">
                <TextBlock.Projection>
                        <PlaneProjection x:Name="sbSuggerimento"/>
                    </TextBlock.Projection>
                </TextBlock>
                <TextBox x:Name="txtRisposta" Width="230" Canvas.ZIndex="4" Margin="130, 80,0,0"></TextBox>
                <Image Source="/SlvPartecipazione;component/IMG/fumetto.png" Stretch="UniformToFill" Style="{StaticResource fumettoStyle}" Canvas.ZIndex="0" />
                <Image Source="/SlvPartecipazione;component/IMG/help.png" Stretch="None" Canvas.ZIndex="1" Margin="128, 115, 0, 0" Cursor="Hand" x:Name="btnHelp" />
                <Image Source="/SlvPartecipazione;component/IMG/confirm.png" Stretch="None" Canvas.ZIndex="1" Margin="330, 115, 0, 0" Cursor="Hand" x:Name="btnConferma" />
            </Canvas>
        </Canvas>
    </Grid>
</UserControl>
